﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MNNUTEM
{
    public partial class Lotes : Form
    {

        private crudLote cLote;

        public Lotes()
        {
            InitializeComponent();
            cLote = new crudLote();
        }

        private void updateGridView()
        {
            dataGridView1.DataSource = cLote.Consultation("select *from Lote");

        }


        private void button1_Click(object sender, EventArgs e)
        {
          cLote.Insert(textBox1,dateTimePicker1.Value.ToShortDateString(),dateTimePicker2.Value.ToShortDateString(), textBox2, textBox3, textBox4);
            updateGridView();
           
        }

        private void Lotes_Load(object sender, EventArgs e)
        {
            dataGridView1.DataSource = cLote.Consultation("select *from Lote");
            updateGridView();
            button1.Enabled = true;
            button2.Enabled = false;
            button3.Enabled = false;
        }
    }
}
